/*
 * @Author: LVGRAPE
 * @LastEditors: LVGRAPE
 */
#include "spl06_api.h"

spl0601_t spl06;

int SPL06_dev_Init(void)
{
    if (spl0601_init(&spl06, 0) != 0)
    {
        // LOG_E("spl0601_init failed");
        return -1;
    }
    spl06_temperature_rate_set(&spl06, PT_MEASUREMENT_RATE_128, PT_OVERSAMPLE_RATE_16);
    spl06_pressure_rate_set(   &spl06, PT_MEASUREMENT_RATE_128, PT_OVERSAMPLE_RATE_16);
    spl0601_start_continuous(&spl06, MEAS_CTRL_CONTINUOUS_P_AND_T_MEASUREMENT);
    return 0;
}
float spl06_dev_get_temperature(void)
{
    spl0601_get_raw_temp(&spl06);
    return spl0601_get_temperature(&spl06);
}
float spl06_dev_get_pressure(void)
{
    spl0601_get_raw_pressure(&spl06);
    return spl0601_get_pressure(&spl06);
}
